#include<iostream>
using namespace std;
const int N=1e5+10;
int nums[N];
int main()
{
	int n,k;cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
		cin>>nums[i];
	}
	int left=1,right=n,leftflag=-1,rightflag=-1;
	while(left<=right)
	{
		int mid=left+(right-left)/2;
		if(nums[mid]>=k)
		{
			leftflag=mid;
			right=mid-1;
		}
		else
		{
			left=mid+1;
		}
	}
	if(leftflag==-1||nums[leftflag]!=k)
	{
		cout<<"{-1,-1}"<<endl;
		return 0;
	}
	left=1,right=n;
	while(left<=right)
	{
		int mid = left + (right - left + 1) / 2; // 上取中
		if(nums[mid]<=k)
		{
			rightflag=mid;
			left=mid+1;
		}
		else
		{
			right=mid-1;
		}
	}
	cout << "{" << leftflag << "," << rightflag << "}" << endl;

}
